package edu.lsnu.equipment_management_system.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author mzy
 * @Description 用于跳转所有的html
 * 关于themeleaf映射需要注意的：
 *      1.所以静态页面映射的时候，mapping后面要以/开头(最好)，不以/开头也行
 *      但是return 后面路径不能以/开头！！！IDE中正常，但是打jar包之后就不行了；如果是war包以斜杠开的话，还要加上项目名！
 *      所以return后面最好不要用/开头！！！
 *
 *      但是有种特殊的情况下要以/开头！
 *     2.转发和重定向的时候：
 *      因为spring的高度封装，其实转发和重定向的区别已经没有servlet中那么明显了！
 *      转发重定向的话，最好还是以/开头，但是前面要加forward:或者redirect:
 *      并且后面不要再直接跟真实的资源路径了[即：springboot中template往下数]
 *      全部使用springboot接管的映射路径[即：mapping后面的]
 *
 *
 * @date 2018/11/16
 */
@Controller
public class PageController {
    @RequestMapping("/bingo.html")
    public String bingo() {
        return "bingo.html";
    }

    // ------------------------站点首页以及前台登陆和后台登陆------------------------
    /**
     * @Description 默认站点的根目录是首页
     * @author mzy
     * @time 2018-11-18
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/")
    public String home() {
        return "page/login.html";
    }

    /**
     * @Description 同样是登陆界面，用于两套匹配规则
     * @author mzy
     * @time 2018-11-18
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/login/user.html")
    public String userLogin() {
        return "page/login.html";
    }

    /**
     * @Description 管理员后台登陆的界面
     * @author mzy
     * @time 2018-11-18
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/login/admin.html")
    public String adminLogin() {
        return "page/admin-login.html";
    }

    // ------------------------用户首页以及管理员首页------------------------
    /**
     * @Description 用户的首页
     * @author mzy
     * @time 2018-11-17
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/index.html")
    public String userIndex() {
        return "page/user/index.html";
    }

    /**
     * @Description 管理员的首页
     * @author mzy
     * @time 2018-11-18
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/index.html")
    public String adminIndex() {
        return "page/admin/admin.html";
    }

    // ----------------分割线：以下是用户的子页面----------------
    /**
     * @Description 显示用户的主页的图表
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/main.html")
    public String userMain() {
        return "page/user/views/main.html";
    }

    /**
     * @Description 新设备入库界面(表单界面)
     * @author mzy
     * @time 2018-11-18
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/purchase.html")
    public String getUserEquipmentPurchase() {
        return "page/user/views/ruKuEquipment.html";
    }

    /**
     * @Description 查看设备信息的界面
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/information.html")
    public String getUserEquipmentInformation() {
        return "page/user/views/equmentInfo.html";
    }

    /**
     * @Description 调入设备，表单
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/transferIn.html")
    public String getUserEquipmentTransferIn() {
        return "page/user/views/diaoRuEquipment.html";
    }

    /**
     * @Description 调出设备，表单
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/transferOut.html")
    public String getUserEquipmentTransferOut() {
        return "page/user/views/diaoChuEquipment.html";
    }

    /**
     * @Description 设备维护维修，表单
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/repair.html")
    public String getUserEquipmentRepair() {
        return "page/user/views/repairHandle.html";
    }

    /**
     * @Description 设备维护维修确认页面(结束维修)
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/repairSure.html")
    public String getUserEquipmentRepairSure() {
        return "page/user/views/repairSure.html";
    }


    /**
     * @Description 设备意外报损信息
     * @author mzy
     * @time 2018-11-18
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/user/damage.html")
    public String getUserEquipmentDamage() {
        return "page/user/views/damageHandle.html";
    }

    // ----------------分割线：以下是管理员的子页面----------------
    /**
     * @Description 获取管理员界面的损废审核列表
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/damage.html")
    public String getAdminDamageList() {
        return "page/admin/views/damage.html";
    }

    /**
     * @Description 获取管理员界面的调出审核列表
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/transferOut.html")
    public String getAdminTransferOutList() {
        return "page/admin/views/diaoChuApply.html";
    }

    /**
     * @Description 获取管理员界面的调入审核列表
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/transferIn.html")
    public String getAdminTransferInList() {
        return "page/admin/views/diaoRuApply.html";
    }

    /**
     * @Description 获取管理员界面的图表页面
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/main.html")
    public String getAdminMain() {
        return "page/admin/views/main.html";
    }

    /**
     * @Description 获取管理员界面的购入审核列表
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/purchase.html")
    public String getAdminPurchaseList() {
        return "page/admin/views/purchaseApply.html";
    }

    /**
     * @Description  获取管理员界面的修护审核列表
     * @author mzy
     * @time 2018-11-19
     * @see
     * @return   java.lang.String
     * @params  []
     */
    @RequestMapping("/page/admin/repair.html")
    public String getAdminRepairList() {
        return "page/admin/views/repairHandle.html";
    }

    // ----------------管理员：增加用户----------------
    @RequestMapping("/page/admin/addUser.html")
    public String addUser() {
        return "page/admin/views/addUser.html";
    }


    // --------------管理员：运行使用的审核页面----------------
    @RequestMapping("/page/admin/runningUse.html")
    public String runningUse() {
        return "page/admin/views/runningUse.html";
    }


    // --------------管理员：日志界面：--------------
    // 购入审核日志页面
    @RequestMapping("/page/admin/purchaseReviewLog.html")
    public String purchaseReviewLog() {
        return "page/admin/views/purchaseReviewLog.html";
    }

    // 损毁审核日志页面
    @RequestMapping("/page/admin/damageReviewLog.html")
    public String damageReviewLog() {
        return "page/admin/views/damageReviewLog.html";
    }

    // 维修维护审核日志页面
    @RequestMapping("/page/admin/repairReviewLog.html")
    public String repairReviewLog() {
        return "page/admin/views/repairReviewLog.html";
    }

    // 调入审核日志页面
    @RequestMapping("/page/admin/transferInReviewLog.html")
    public String transferInReviewLog() {
        return "page/admin/views/transferInReviewLog.html";
    }

    // 调出审核日志页面
    @RequestMapping("/page/admin/transferOutReviewLog.html")
    public String transferOutReviewLog() {
        return "page/admin/views/transferOutReviewLog.html";
    }

    // 运行使用审核日志：useRecordReviewLog
    @RequestMapping("/page/admin/useRecordReviewLog.html")
    public String useRecordReviewLog() {
        return "page/admin/views/useRecordReviewLog.html";
    }

    // 管理员界面：新增+管理员全体设备查看界面
    @RequestMapping("/page/admin/information.html")
    public String getAdminEquipmentInformation() {
        return "page/admin/views/equmentInfo.html";
    }
}
